package dongzhe;
import java.io.*;
//import java.time.temporal.Temporal;
public class FileIO {
	public FileIO(){};
	public String[] readAllLine(String name){
		int count = 0;
		String temp[] = new String[1000];
		try{
			FileReader fr = new FileReader(name);
			BufferedReader br = new BufferedReader(fr);
			String line;
			while((line =br.readLine())!=null ){
				temp[count++] = line;
			}
			br.close();
			fr.close();
			
		}
		catch(IOException e){
			e.printStackTrace();
		}
		return temp;
		
	}
	public boolean writeLine(String name,String content){
	
		try{
			FileWriter fw= new FileWriter(name,true);
			BufferedWriter bw= new BufferedWriter(fw);
			bw.newLine();
			bw.write(content);
			bw.flush();
			bw.close();
			fw.close();
		}
		catch(IOException e){
			return false;
		}
		return true;
		
	}
}
